<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>医生业绩</title>
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/mui.min.css" />
		<link rel="stylesheet" href="../../../css/mui.picker.min.css" >
		<link rel="stylesheet" href="../../../css/mui.poppicker.css" />
		<link rel="stylesheet" href="../../../css/iconfont.css" />
		<link rel="stylesheet" href="../../../css/cmms.css" />
		<link rel="stylesheet" href="../../../css/sale/statistics/docPerform.css" />
	</head>
	<style type="text/css">
		
	</style>
	<body>
		<div class="mui-content" id="docPerform" v-cloak>
			<div class="topTime bgColorfff">
				<div class="selectDate addLine">
					<span @click="selectStart">{{startTime}}<i class="iconfont icon-jiantou"></i></span>
					<span @click="selectEnd">{{endTime}}<i class="iconfont icon-jiantou"></i></span>
				</div>
		    	<div class="statBox">
		    		<div class="line1">
			    		<p>
				    		<span>诊所数</span>
				    		<span>{{docList.hopitalNum}}</span>
				    	</p>
				    	<p>
				    		<span>医生数</span>
				    		<span>{{docList.doctorNum}}</span>
				    	</p>
				    	<p>
				    		<span>订单数</span>
				    		<span>{{docList.orderNum}}</span>
				    	</p>
				    	<p>
				    		<span>出单天</span>
				    		<span>{{docList.outOrderDay}}</span>
				    	</p>
				    	<p>
				    		<span>业务员</span>
				    		<span>{{docList.saleNum}}</span>
				    	</p>
			    	</div>
		    	</div>
			</div>
			
	    	<div class="panel" v-for="docs in docList.list">	
		    	<div class="statBox" >
		    		<P class="line addLine">
	    				<!--<span>{{docs.doctorId}}</span>-->
	    				<span>{{docs.doctorName}} 医生</span>
		    			<span class="right basic-color">{{docs.amount}}</span>
		    			<span class="right">检验费</span>
		    			<span class="right basic-color">{{docs.orderNumDay}}</span>
		    			<span class="right">订单数量</span>
		    		</P>
		    		<div class="line1 addLine">
		    			<p>
				    		<span>检验金额</span>
				    		<span>{{docs.amount}}</span>
				    	</p>
				    	<!--添加优惠-->
				    	<!--<p>
				    		<span>优惠金额</span>
				    		<span>{{docs.commissionAmount}}</span>
				    	</p>-->
				    	<p>
				    		<span>分成金额</span>
				    		<span>{{docs.commissionAmount}}</span>
				    	</p>
				    	<p>
				    		<span>实收金额</span>
				    		<span>{{docs.actualAmount}}</span>
				    	</p>
		    		</div>
		    		<p class="addr addLine">{{docs.hospitalName}}</p>
		    		<p class="line3">
		    			<span>已合作{{docs.day}}天</span>
		    			<span class="right">{{docs.saleCode}} {{docs.saleName}}</span>
		    			<!--<span class="right">{{docs.saleId}}</span>-->
		    		</p>
		    	</div>
		    </div>
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/mui.picker.min.js"></script>
		<script src="../../../js/mui.poppicker.js"></script>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../../../js/vue.js"></script>
		<script src="../../../js/cmms.js?time=333"></script>
		<script>
			new Vue({
				el:"#docPerform",
				data:{
					endTime:'',
					startTime:'',
					docList:[]
				},
				mounted(){
					this.loadInfo();
				},
				methods:{
					loadInfo(){
						let _this = this;
						/*查询销售主页信息*/
						var nowDate = new Date();
						let y = nowDate.getFullYear();
						let m = nowDate.getMonth() + 1;
								    
						m = m<10?"0" + m:m;
						let d = nowDate.getDate();
						d = d<10?"0" + d:d;
						_this.startTime = ''+y+m+d;
						_this.endTime = ''+y+m+d;
						AT.muiAjax('/partner-sale/statistics/getDoctor','post',{						
							endTime: _this.endTime,
  							starTime: _this.startTime
						},
						function(res){
							console.log(res);
							_this.docList = res;
						});
					},
					selectStart(){
						let _this = this;
						_this.loadLabel='start';
						var dtpicker = new mui.DtPicker({
							type:'date',
							beginDate:'',
							endDate:new Date()
						});
						dtpicker.show(function(e) {
//						    console.log(e);
							_this.startTime = e.y.value+e.m.value+e.d.value;
							if(_this.startTime>_this.endTime){
						    	alert('开始时间不能大于结束时间');
						   }else{
							    AT.muiAjax('/partner-sale/statistics/getDoctor','post',{						
									endTime: _this.endTime,
		  							starTime: _this.startTime
								},
								function(res){
									console.log(res);
									_this.docList = res;
								});
						    }
							dtpicker.dispose();
						}) ;
						
					},
					selectEnd(){
						let _this = this;
						_this.loadLabel='end';
						var dtpicker = new mui.DtPicker({
							type:'date',
							beginDate:'',
							endDate:new Date()
						}) 
						dtpicker.show(function(e) {
//							console.log(e);
							_this.endTime = e.y.value+e.m.value+e.d.value;
							if(_this.startTime>_this.endTime){
						    	alert('开始时间不能大于结束时间');
						  	}else{
							    AT.muiAjax('/partner-sale/statistics/getDoctor','post',{						
									endTime: _this.endTime,
		  							starTime: _this.startTime
								},
								function(res){
									console.log(res);
									_this.docList = res;
								});
						    }
						    dtpicker.dispose();
						});
						
					}
				}
			})
		</script>
	</body>
</html>